<?php
/**
 * User: 五哥派
 * Date: 2024/7/1
 * Tel(同WX): 17335592719
 */
namespace app\api\model\store;

use app\api\model\Base;

class GoodsSku extends Base{

    protected $name = 'store_goods_sku';

    public function goods() {
        return $this->hasOne(Goods::class, "id",  "goods_id");
    }

    public function  incStock($id, $num) {
        return $this->where("id", "=", $id)
            ->inc("stock", $num)
            ->update();
    }

}